﻿using System;
using System.Runtime.Serialization;

namespace ShuttleBus.AdminMessages
{
    [DataContract]
    [Serializable]
    public class Subscription
    {
        public Subscription(Uri fromLocation, Type messageType)
        {
            Location = fromLocation;
            MessageType = messageType.AssemblyQualifiedName;
            Name = messageType.Name;
        }

        [DataMember]
        [Obsolete]
        public Uri Location { get; set; }

        [DataMember]
        public string Name { get; set; }

        [DataMember]
        public string MessageType { get; set; }

        [IgnoreDataMember]
        internal IEndpoint Endpoint { get; set; }
    }
}